package demo.classs;

public class InheritanceClass {
	public static void main(String[] args)
	{
		ClassCon con = new ClassCon();
		con.setTen("asd");
		con.printTen();
		ClassCha cha = new ClassCha();
		cha.printTen();
	}
}


class ClassCha
{
	String ten;
	public void setTen(String ten)
	{
		this.ten = ten;
	}
	
	public void printTen()
	{
		if (ten != null) {
			System.out.println(ten);
		}
		else
			System.out.println("Khong co ten");
	}
}

class ClassCon extends ClassCha
{
	
	@Override
	public void setTen(String ten) {
		super.setTen(ten);
	}
		
}